import request from '@/utils/request'

//++++++++++++++++用户管理接口+++++++++++++++++++++++
export function getUserPage(params) {
  return request({
    url: 'User/GetUserPage',
    method: 'get',
    params
  })
}
export function getUser(params) {
  return request({
    url: 'User/GetUser',
    method: 'get',
    params
  })
}

export function lockOrUnlock(params) {
  return request({
    url: 'User/LockOrUnlock',
    method: 'post',
    data: params
  })
}

//++++++++++++++++员工管理接口+++++++++++++++++++++++
//获取员工列表数据
export function getEmployeePage(params) {
  return request({
    url: 'Employee/GetEmployeePage',
    method: 'get',
    params
  })
}

export function getEmployeeList(params) {
  return request({
    url: 'Employee/GetEmployeeList',
    method: 'get',
    params
  })
}

//添加员工
export function addEmployee(params) {
  return request({
    url: 'Employee/AddEmployee',
    method: 'post',
    data: params
  })
}

//编辑员工
export function editEmployee(params) {
  return request({
    url: 'Employee/UpdateEmployee',
    method: 'put',
    data: params
  })
}

//删除员工
export function deleteEmployee(params) {
  return request({
    url: 'Employee/DeleteEmployee',
    method: 'DELETE',
    params
  })
}

//++++++++++++++++组织管理接口+++++++++++++++++++++++
//获取职位树数据
export function getJobPositionTree(params) {
  return request({
    url: 'JobPosition/ParseTree',
    method: 'get',
    params
  })
}
//添加职位
export function addJobPositionItem(params) {
  return request({
    url: 'JobPosition/AddJobPosition',
    method: 'post',
    data: params
  })
}
//删除职位
export function delJobPositionItem(params) {
  return request({
    url: 'JobPosition/DeleteJobPosition',
    method: 'DELETE',
    params
  })
}
//编辑职位信息
export function editJobPositionItem(params) {
  return request({
    url: 'JobPosition/UpdateJobPosition',
    method: 'put',
    data: params
  })
}

//++++++++++++++++角色管理接口+++++++++++++++++++++++
//分页获取角色列表
export function getRolePage(params) {
  return request({
    url: 'Role/PageRole',
    method: 'get',
    params
  })
}

//获取角色列表
export function getRoleList(params) {
  return request({
    url: 'Role/GetRole',
    method: 'get',
    params
  })
}
//获取角色下面的员工
export function getRoleEmployee(params) {
  return request({
    url: 'Role/GetRoleEmployee',
    method: 'get',
    params
  })
}

//添加角色
export function addRole(params) {
  return request({
    url: 'Role/AddRole',
    method: 'post',
    data: params
  })
}

//编辑角色
export function editRole(params) {
  return request({
    url: 'Role/UpdateRole',
    method: 'put',
    data: params
  })
}
//删除角色
export function deleteRole(params) {
  return request({
    url: 'Role/DeleteRole',
    method: 'DELETE',
    params
  })
}
//角色添加员工
export function addRoleEmployee(params) {
  return request({
    url: 'Role/AddRoleEmployee',
    method: 'post',
    data: params
  })
}
//角色添加权限
export function addRolePermisson(params) {
  return request({
    url: 'Role/AddRolePower',
    method: 'post',
    data: params
  })
}
//++++++++++++++++权限管理接口+++++++++++++++++++++++

//获取角色下面的员工
export function getPermissionTree(params) {
  return request({
    url: 'Role/ParseTree',
    method: 'get',
    params
  })
}
//获取角色下面的员工
export function getUserMenus(params) {
  return request({
    url: 'Role/GetUserMenus',
    method: 'get',
    params
  })
}


//根据角色ID返回权限数组
export function getRolePermissionTree(params) {
  return request({
    url: 'Role/GetRolePower',
    method: 'get',
    params
  })
}

//根据权限ID返回角色数组
export function getPermissionRoleTree(params) {
  return request({
    url: 'Role/GetPowerRole',
    method: 'get',
    params
  })
}

//权限添加角色
export function addPermissonRole(params) {
  return request({
    url: 'Role/AddPowerRole',
    method: 'post',
    data: params
  })
}
// ===========二维码生成=============
//二维码生成器
export function BatchGenerateQRCode(params) {
  return request({
    url: 'Payment/BatchGenerateQRCode',
    method: 'post',
    data: params,
  })
}
//分页查询二维码模板
export function SearchQrCodeModelsByPage(params) {
  return request({
    url: 'Payment/SearchQrCodeModelsByPage',
    method: 'get',
     params,
  })
}
//新建或修改二维码模板
export function SaveQrCodeModel(params) {
  return request({
    url: 'Payment/SaveQrCodeModel',
    method: 'post',
     data:params,
  })
}
//删除二维码模板
export function DeleteQrCode(params) {
  return request({
    url: 'Payment/DeleteQrCode',
    method: 'delete',
     params,
  })
}
//预览图片
export function GetQrCodePreview(params) {
  return request({
    url: 'Payment/GetQrCodePreview',
    method: 'get',
     params,
  })
}

// ========= APK管理 ============
// 分页获取优惠券列表
export function SearchAppPackagesByPage(params) {
  return request({
    url: 'PublishedClient/GetPage',
    method: 'get',
    params
  })
}
// 分页获取优惠券列表
export function SaveAppPackage(params) {
  return request({
    url: 'PublishedClient/Save',
    method: 'put',
    data:params
  })
}

// 分页获取优惠券列表
export function DeleteAppPackage(params) {
  return request({
    url: 'PublishedClient/Delete',
    method: 'delete',
    params
  })
}


/**
 * 店铺查询所有员工的操作日志
 */
export function GetAllBizLogs(params) {
	return request({
		url: 'Biz/GetAllBizLogs',
		method: 'get',
		params
	})
}
/**
 * 获取所有的业务模块
 */
export function GetBizModules(params) {
	return request({
		url: 'Biz/GetBizModules',
		method: 'get',
		params
	})
}
/**
 * 获取运营拓展数据
 */
export function GetSalesmanOperatingValues(params) {
	return request({
		url: 'Common/GetSalesmanOperatingValues',
		method: 'get',
		params
	})
}